import React, { memo } from "react";
import styles from "./index.module.scss";
// import './index.scss'
// export default function Home () {
//   // 确保这里没有未定义的变量或其他可能导致错误的代码
//   return (
//     <div className={styles.home}>
//       <h1>Home</h1>
//     </div>
//   );
// }

const MyComponent = ({ name, age }) => (
  <div className={styles.home}>
    <p>Name: {name}</p>
    <p>Age: {age}</p>
    <p>This component is memoized.</p>
  </div>
);

const arePropsEqual = (prevProps, nextProps) => {
  return prevProps.name === nextProps.name && prevProps.age === nextProps.age;
};

export default memo(MyComponent, arePropsEqual);
